From: Keir Fraser Date: Fri, 20 May 2011 08:07:54 +0000 (+0100) Subject: nestedsvm: reduce TLB flushes X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10342 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=c33a0b24c1f04d45d79c0b5657ecb25677dd1fb2;p=xen.git nestedsvm: reduce TLB flushes Reduce TLB flushes: 1. When we update the cr3 during VMRUN/VMEXIT emulation we toggle between n1asid and n2asid forth and back => no TLB flush needed 2. Only flush n1asid or n2asid depending on vcpu guest mode and not both unconditionally. Signed-off-by: Christoph Egger Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 8b1557b8ca..55d76323f3 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -454,7 +454,7 @@ static void svm_update_guest_cr(struct vcpu *v, unsigned int cr) if ( !nestedhvm_enabled(v->domain) ) hvm_asid_flush_vcpu(v); else if ( nestedhvm_vmswitch_in_progress(v) ) - ; /* We toggle between n1asid/n2asid -> no flush required. */ + ; /* CR3 switches during VMRUN/VMEXIT do not flush the TLB. */ else hvm_asid_flush_vcpu_asid( nestedhvm_vcpu_in_guestmode(v)